"""
desktop file
Exec=osso-xterm -e /usr/bin/europe1
Terminal=false

#
# setup.py
#
# Example usage:
#
#   python setup.py sdist --force-manifest
#   python setup.py sdist
#   python setup.py bdist_maemo
#   python setup.py bdist_wininst
#   python setup.py bdist_msi
#
# NOTE! Run in a clean environment, packages directive just picks all source code up
#
#  Author: 
#
#    Date: 
#
# License: 
"""

import glob
import os

from distutils.core import setup
from bdist_maemo import bdist_maemo as _bdist_maemo


def filter_py_extension(x):
    #return os.path.basename(x, 'py')
    basex, extx = os.path.splitext(x)
    if extx == '.py':
        return basex
    else:
        return x
    
topfiles=glob.glob('*.py')# + glob.glob('*.glade')
#topfiles_filtered=map(filter_py_extension, glob.glob('*.py'))
topfiles_filtered=map(filter_py_extension, topfiles)
print topfiles_filtered
print topfiles
setup(
        name="pytombo",
        #scripts=['example'],
        version='0.0.1',
        maintainer="clach04",
        maintainer_email="clach04@gmail.com",
        url='http://code.google.com/p/pytombo/',
        description="Plain text or encrypted (.chi) text notes tool and search",
        long_description=\
        "Pure Python application and library for access Tombo notes as well as plain text files",
        #data_files = [('share/applications/hildon', ['example.desktop'])],
        cmdclass={'bdist_maemo': _bdist_maemo},
        packages=['pytombo',], ## Works
        #py_modules = ['mod1', ],
        py_modules = topfiles_filtered,## Works for source only, e.g. not glade files
        #data_files = [('opt', topfiles),], ## DO NOT WORK for regular setup.py unless in MANIFEST(.in)!
        #data_files = [(topfiles)], # should warn , so far it does not ## DO NOT WORK for regular setup.py unless in MANIFEST(.in)!
    )
